﻿namespace MySqlSync.Core.Models
{
    /// <summary>
    /// 同步服务配置
    /// </summary>
    public class SyncConfig
    {
        /// <summary>
        /// 源数据库连接字符串
        /// </summary>
        public string SourceConnectionString { get; set; } = string.Empty;

        /// <summary>
        /// 目标数据库连接字符串
        /// </summary>
        public string TargetConnectionString { get; set; } = string.Empty;

        /// <summary>
        /// 需要同步的表名列表
        /// </summary>
        public List<string> Tables { get; set; } = new List<string>();

        /// <summary>
        /// 批量处理大小
        /// </summary>
        public int BatchSize { get; set; } = 1000;

        /// <summary>
        /// 同步间隔（秒）
        /// </summary>
        public int SyncIntervalSeconds { get; set; } = 10;

        /// <summary>
        /// Kafka配置
        /// </summary>
        public KafkaConfig Kafka { get; set; } = new KafkaConfig();

        /// <summary>
        /// Redis配置
        /// </summary>
        public RedisConfig Redis { get; set; } = new RedisConfig();
    }

    /// <summary>
    /// Kafka配置
    /// </summary>
    public class KafkaConfig
    {
        /// <summary>
        /// Bootstrap服务器地址
        /// </summary>
        public string BootstrapServers { get; set; } = string.Empty;

        /// <summary>
        /// 主题名称
        /// </summary>
        public string Topic { get; set; } = string.Empty;

        /// <summary>
        /// 消费者组ID
        /// </summary>
        public string GroupId { get; set; } = string.Empty;
    }

    /// <summary>
    /// Redis配置
    /// </summary>
    public class RedisConfig
    {
        /// <summary>
        /// 连接字符串
        /// </summary>
        public string ConnectionString { get; set; } = string.Empty;

        /// <summary>
        /// 数据库编号
        /// </summary>
        public int Database { get; set; } = 0;
    }

}
